<template>
  <div class="event-item">
    <component :is="comp" :data="compData"></component>
  </div>
</template>

<script lang="ts">
import { defineComponent, PropType, ref, toRaw, unref } from 'vue';
import { EventComment, EventType, EventVariable } from '../store/events';
import CompEventComment from './comment.vue';

export default defineComponent({
  name: 'event-item',
  components: { CompEventComment },
  emits: [],
  props: {
    data: {
      type: Object as PropType<EventComment | EventVariable>,
    },
  },
  setup(props, { emit }) {
    const comp = ref();
    const compData = ref();
    console.error(toRaw(props));

    return {
      comp,
      compData,
    };
  },
});
</script>
<style scoped lang="scss">
.event-item {

}
</style>
